package com.enums;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public enum Month {
	     month1(1, 1),month2(2, 2), month3(3, 3), month4(4, 4), month5(5,
			5), month6(6, 6), month7(7, 7), month8(8, 8), month9(9,
			9), month10(10, 10), month11(11, 11), month12(12, 12);

	private int monthId;

	private int monthName;

	private static Map<Integer, Month> constantsMap; 

	private static List<Month> monthList; 

	static {
		constantsMap = new HashMap<Integer, Month>();
		monthList = new ArrayList<Month>();
		for (Month c : Month.values()) {
			monthList.add(c);
			constantsMap.put(c.monthId, c);
		}
	}

	
	public static Month gethourById(Integer monthId) {
		return constantsMap.get(monthId);
	}

		public static int gethourNameById(Integer hourId) {
		return constantsMap.get(hourId).getmonthName();
	}

	
	Month(int monthId, int monthName) {
		this.monthId = monthId;
		this.monthName = monthName;
	}

	public int getmonthId() {
		return monthId;
	}

	public int getmonthName() {
		return monthName;
	}

	
	public static List<Month> getMonthList() {
		return monthList;
	}


}
